package com.yanqu.road.logic.activity.foxcard.game.effect;

import com.yanqu.road.entity.activity.foxcard.FoxBaseCard;
import com.yanqu.road.entity.activity.foxcard.FoxHandCard;
import com.yanqu.road.logic.activity.foxcard.game.FoxCardGameLogic;
import com.yanqu.road.logic.activity.foxcard.game.eFoxCardTriggerType;

import java.util.Collections;
import java.util.List;

/**
 * 根据出牌的牌数量加效果
 */
public class FoxCardEffect29 extends FoxCardEffectBase {
    @Override
    protected void effectHandle(FoxCardGameLogic gameLogic, FoxHandCard handCard) {
        if (triggerType != eFoxCardTriggerType.AFTER_SCORE) {
            return;
        }

        int minNum = Integer.valueOf(effectConfig.getParamsList().get(0));
        int maxNum = Integer.valueOf(effectConfig.getParamsList().get(1));

        int showNum = gameLogic.getShowHandCards().size();

        if (showNum < minNum || showNum > maxNum) {
            return;
        }

        int addBaseScore = Integer.valueOf(effectConfig.getParamsList().get(2));
        int addBaseScoreMulti = Integer.valueOf(effectConfig.getParamsList().get(3));
        int addBaseMulti = Integer.valueOf(effectConfig.getParamsList().get(4));
        int addBaseMultiMulti = Integer.valueOf(effectConfig.getParamsList().get(5));
        int goldChange = Integer.valueOf(effectConfig.getParamsList().get(6));

        List<FoxBaseCard> settleCards = Collections.singletonList(effectCard);
        gameLogic.addBaseScore(addBaseScore, settleCards, null); //加基础筹码
        gameLogic.addBaseScoreMulti(addBaseScoreMulti, settleCards, null); //当前基础筹码乘算
        gameLogic.addBaseMulti(addBaseMulti, settleCards, null); //加基础倍率
        gameLogic.addBaseMultiMulti(addBaseMultiMulti, settleCards, null); //当前基础倍率乘算
        gameLogic.goldChange(goldChange, settleCards, null, triggerType); //加金币

    }
}
